<div class="row" style="margin-bottom: 20px; margin-top: -15px;">
    <div class="col-sm-12">
        <h3>
            <i class="fa fa-edit" style="color:<?php echo $color?>"></i> <?php echo $title?>
        </h3>
    </div>
</div>
<div class="row">
    <div class="col-sm-12">
        <form action="<?php echo base_url('admin/pages/edit').'/'.$result['p_id'];?>" id="frm_Server_New" class="form-horizontal"   method="post">
            <div class="form-group <?php if(form_error('p_title') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                   Name<span style="color: red;">*</span>
                </label>
                <div class="col-sm-10" style="padding:0px;">
                    <input type="text" class="form-control" placeholder="Name server" name="p_title" value = "<?php if($result['p_title'] != NULL){ echo $result['p_title'];}else{echo set_value('p_title');}?>">
                    <?php echo form_error('p_title','<p class="help-block">','</p>');?>
                </div>
            </div>
            
            <div class="form-group <?php if(form_error('p_contents') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                   Content <span style="color: red;">*</span>
                </label>
                <div class="col-sm-10" style="padding:0px;">
                    <textarea name="p_contents" id="editor1" cols="30" rows="10"><?php if($result['p_contents'] != NULL){ echo $result['p_contents'];}else{echo set_value('p_contents');}?></textarea>
                    <?php echo form_error('p_contents','<p class="help-block">','</p>');?>
                </div>
            </div>

            <div class="form-group <?php if(form_error('p_meta') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                   Meta<span style="color: red;">*</span>
                </label>
                <div class="col-sm-10" style="padding:0px;">
                    <input type="text" class="form-control" placeholder="meta" name="p_meta" value = "<?php if($result['p_meta'] != NULL){ echo $result['p_meta'];}else{echo set_value('p_meta');}?>">
                    <?php echo form_error('p_meta','<p class="help-block">','</p>');?>
                </div>
            </div>
            
            <div class="form-group ">
                <label class="col-sm-2 control-label" for="subject">Active</label>
                <div class="col-sm-10">
                    <input type="checkbox" name="status" value="1" <?php if($result['status'] == 1){echo 'checked = ""';}?>>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    jQuery(document).ready(function($) {
        $('.btn-index').css({display:'none'});
        $('.btn-edit').css({display:'inline-block'});
        $('.btn-copy').css({display:'none'});
        $('.btn-add').css({display:'none'});
        $('.content input[type="checkbox"]').iCheck({checkboxClass: 'icheckbox_minimal'});
        $('.content input[type="radio"]').iCheck({radioClass: 'iradio_minimal'});
    });

    $(function() {
                // Replace the <textarea id="editor1"> with a CKEditor
                // instance, using default configuration.
                CKEDITOR.replace('editor1');
                //bootstrap WYSIHTML5 - text editor
                $(".textarea").wysihtml5();
            });

    function Edit(){
        $(".content").mask("<?php echo 'Loading...'; ?>");
        $("#frm_Server_New").submit();
    }

    function back_to_list(){
        $(".content").mask("<?php echo 'Loading...'; ?>");
        var url = '<?php echo base_url("admin/pages");?>';
        window.location.href = url;
    }
</script>